#ifndef _DOCSTRUCTURE_H
#define _DOCSTRUCTURE_H

#define MAX 100

#include "ImageMGR.h"

#include <string>

using namespace std;

class DocStructure
{
	public:	//Default Function : Create & Destroy & Operator
		DocStructure();
		DocStructure( const DocStructure& source );
		~DocStructure();
	
		DocStructure& operator = ( const DocStructure& source );
		bool operator == ( const DocStructure& other );
		bool operator != ( const DocStructure& other );

	public: //Access Function
		string GetStart(string role);
		string GetEnd(string role);
		int SetTemplate(string role, string start, string end);

		ImageMGR GetImageMGR();

	public:	//General Function
		int GetData( string role, string* document, string* ret );
		int GetDesc( string link, string* doucment, string* ret );
		int GetTag( string* document, int* count, string** tagSet );
		
	private:
		string role[MAX];
		string start[MAX];
		string end[MAX];
		int count;

		ImageMGR imageMGR;
};

inline string DocStructure::GetStart( string role )
{
	int i = 0;
	
	while ( i < MAX && (this->role)[i] != role )
	{
		i++;
	}
	return (this->start)[i];
}


inline string DocStructure::GetEnd( string role )
{
	int i = 0;

	while ( i < MAX && (this->role)[i] != role )
	{
		i++;
	}
	return (this->end)[i];
}

inline int DocStructure::SetTemplate( string role, string start, string end )
{
	this->role[ this->count] = role;
	this->start[ this->count ] = start;
	this->end[ this->count ] = end;

	(this->count)++;

	return (this->count - 1);
}

inline ImageMGR DocStructure::GetImageMGR()
{
	return ( this->imageMGR );
}

#endif
